﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcCoffeeShop.Models;
using MvcCoffeeShop.DataTransferObjects;


namespace MvcCoffeeShop.Controllers
{
    public class HomeController : Controller
    {

       
        public ActionResult Index()
        {
            ViewBag.Message = "The areas finest coffee";
            HttpContext.Session["Hello"] = "Isaac";

            return View();
        }

        //[Authorize]
        public ActionResult About()
        {
            ViewBag.Message = "Deliverying the Finest Coffee";

            return View();
        }


        public ActionResult Catalog()
        {
            ProductModels oProductModel = new ProductModels();
            List<ProductDTO> oProductList = new List<ProductDTO>();

            oProductList = oProductModel.GetProducts();

            return View(oProductList);
        }

        public JsonResult ProductCatalog()
        {
            ProductModels oProductModel = new ProductModels();
            List<ProductDTO> oProductList = new List<ProductDTO>();

            oProductList = oProductModel.GetProducts();
            
            return Json(oProductList, JsonRequestBehavior.AllowGet);

        }

        public ActionResult Events()
        {

            ViewBag.Message = "Here is a list of events";

            return View();

        }
    }
}
